<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/commons/basejs.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>标签管理</title>
    <script type="text/javascript">

    </script>
</head>
<body>
<script type="text/javascript">
    $(function() {
        $('#userInfoAddForm').form({
            url : '${path }/userInfo/add.do',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                console.log(result);
                if (result.success) {
                    console.log("success:"+result.success);
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    console.log("error:"+result.success);
                    var form = $('#userInfoAddForm');
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
<div style="padding: 3px;">
    <form id="userInfoAddForm" method="post">
        <table class="grid">

            <tr>
                <td>用户名</td>
                <td><input name="username" type="text" placeholder="请输入用户名" class="easyui-validatebox span2" data-options="required:true" ></td>
            </tr>

            <tr>
                <td>密码</td>
                <td><input name="pwd" type="text" placeholder="请输入密码" class="easyui-validatebox span2" data-options="required:true" ></td>
            </tr>
            <tr>
                <td>确认密码</td>
                <td><input name="checkPwd" type="text" placeholder="请确认密码" class="easyui-validatebox span2" data-options="required:true" ></td>
            </tr>

            <tr>
                <td>手机号</td>
                <td><input name="phone" type="text" placeholder="请输入手机号" class="easyui-validatebox span2" data-options="required:true" ></td>
            </tr>


            <tr>
                <td>类型</td>
                <td>
                    <select name="type" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
                        <option value="1">商家</option>
                        <option value="0">用户</option>
                        <option value="2">员工</option>
                        <option value="3">专家</option>
                        <option value="4">企业</option>
                    </select>
                </td>

            </tr>
            <tr>
                <td>状态</td>
                <td>
                    <select name="status" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
                        <option value="1">启用</option>
                        <option value="0">停用</option>
                    </select>
                </td>

            </tr>
        </table>
    </form>

</div>
</body>
</html>